<template>
  <div class="t-footer">
    <div class="t-footer-content">
      <mx-link
        v-for="item in links"
        :key="item.text"
        :href="item.link"
        :to="item.link"
        :with-locale="item.withLocale"
        target="_blank"
        class="link"
      >
        {{ $t(item.text) }}
      </mx-link>
      <p class="text ml-auto">© 2022 TNAOT</p>
      <p class="text ml-16">{{ $t('Kohthmey_TNAOT') }}</p>
    </div>
  </div>
</template>

<script>
import MxLink from './MxLink.vue';
import { LANGUAGE } from '@/constants/index';

export default {
  components: {
    MxLink
  },

  computed: {
    language() {
      return this.$store.state.app.language;
    },
    links() {
      if (this.language === LANGUAGE.ZH) {
        return [
          {
            text: 'Download_APP',
            link: '/m/download',
            withLocale: true
          },
          {
            text: 'privacy_policy',
            link: '/m/privacy',
            withLocale: true
          },
          // {
          //   text: 'cooperation_in_ad',
          //   link: 'https://kh.tnaot.com/ad',
          //   withLocale: false
          // },
          {
            text: 'contact_us',
            link: '/m/contactus',
            withLocale: true
          },
          {
            text: 'More_Link',
            link: '/m/friendly-link',
            withLocale: true
          },
          {
            text: 'More_Link2',
            // link: 'https://tnaot.com/ads-cn.html',
            link: '/m/ad/zh',
            withLocale: true
          }
        ];
      }

      return [
        {
          text: 'Download_APP',
          link: '/m/download',
          withLocale: true
        },
        {
          text: 'privacy_policy',
          link: '/m/privacy',
          withLocale: true
        },
        // {
        //   text: 'cooperation_in_ad',
        //   link: 'https://kh.tnaot.com/ad-en',
        //   withLocale: false
        // },
        {
          text: 'contact_us',
          link: '/m/contactus',
          withLocale: true
        },
        {
          text: 'More_Link',
          link: '/m/friendly-link',
          withLocale: true
        },
        {
          text: 'More_Link2',
          // link: 'https://tnaot.com/ads-en.html',
          link: '/m/ad/en',
          withLocale: true
        }
      ];
    }
  }
};
</script>

<style lang="scss" scoped>
@import '~assets/styles/variable.scss';

.t-footer {
  width: 100%;
  background: #ffffff;
  box-shadow: 0 -1px 0 0 rgba(12, 12, 28, 0.06);
}

.t-footer-content {
  width: $page-width;
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;

  .link {
    font-size: 14px;
    color: rgba(12, 12, 28, 0.7);
    margin-right: 28px;
  }
  .text {
    font-size: 12px;
    color: rgba(12, 12, 28, 0.7);
  }
}
</style>
